home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_218 / edlib / stricmp.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  531b  |  22 lines

  1. /*
  2.  * edlib v1.1 Copyright 1989 Edwin Hoogerbeets
  3.  * This code is freely redistributable as long as no charge other than
  4.  * reasonable copying fees are levied for it.
  5.  */
  6.  
  7. #include <ctype.h>
  8.  
  9. int stricmp(str1,str2)
  10. register char *str1,*str2;
  11. {
  12.     register int index = 0;
  13.  
  14.     while ( str1[index] && str2[index] &&
  15.             tolower(str1[index]) == tolower(str2[index]) )
  16.         ++index;
  17.  
  18.     return( (tolower(str1[index]) < tolower(str2[index])) ? -1 :
  19.           ( (tolower(str1[index]) > tolower(str2[index])) ?  1 : 0) );
  20. }
  21.  
  22.